<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <include file="Public:jquery" />
        <include file="Public:dialog" />
        <include file="Public:startapp" />
        <include file="Public:startmoo" />
        <script type="text/javascript">
            $(function(){
                $('.edit_group').click(function(){
					var edit_group_url = $(this).attr('href');
					var edit_group = art.dialog({
						lock : true,
						title : '编辑分组'
					});
					$.ajax({
						url : edit_group_url,
						success : function(data){
							edit_group.content(data);
							submitstyle();
						},
						cache : false
					});
					return false;
				});
				
				$('#add_user').click(function(){
					var $add_action = art.dialog({
						title : $(this).val(),
						lock : true
					});
					
					$.ajax({
						url : "__URL__/add",
						success : function(data){
							$add_action.content(data);
							submitstyle();
						},
						cache : false
					});
					
					return false;
				});
				
				$('.edit_user').click(function(){
					var edit_url = $(this).attr('href');
					var edit_user = art.dialog({
						title : "编辑用户",
						lock : true
					});
					$.ajax({
						url : edit_url,
						success : function(data){
							edit_user.content(data);
							submitstyle();
						},
						cache : false
					});
					return false;
				});
				
				$('#del_user').click(function(){
					if ($('input[name="userid[]"]:checked').length == 0){
						art.dialog({
							content : '请先选择用户',
							lock : true
						});
					}else{
						art.dialog({
							content : '确定要删除吗？',
							ok : function(){
								$('form[name="userlist"]').submit();
							},
							cancel : true,
							lock : true
						});
					}
					return false;
				});
                
            });
            
        </script>
    </head>
    <body>
        <include file="Public:header" />
        
        <div class="layout">
            
            <include file="Public:position" />
            
            <table class="warp" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="sidebar" valign="top">
                        <include file="Public:sidebar" />
                    </td>
                    <td class="contents" valign="top">
                        
                        <div class="button">
                            <a href="javascript:void(0);" class="default_button" id="add_user"><span></span>新增用户</a>
                            <a href="javascript:void(0);" class="default_button" id="del_user" style="margin-left: 10px;"><span></span>删除用户</a>
                        </div>
	                    
                        <div class="a_table">
					    	<form action="__URL__/delete" method="post" name="userlist">
							<table cellspacing="1" class="gr_list" width="100%">
								<tr style="background: #f0f7ff; font-weight: bold;">
									<td width="20" height="20"></td>
									<td width="60" align="center" class="left_text">编号</td>
									<td width="100" align="center" class="left_text">用户名</td>
									<td align="center" class="left_text">昵称</td>
									<td align="center" class="left_text">Email</td>
									<td align="center" class="left_text">添加时间</td>
									<td align="center" width="180" class="left_text">上次登录</td>
									<td align="center" class="left_text">登录次数</td>
									<td align="center" width="40" class="left_text">状态</td>
									<td align="center" width="100" class="left_text">操作</td>
								</tr>
								<volist id="vo" name="list">
								<tr rel="{$vo['id']}">
									<td><input type="checkbox" name="userid[]" value="{$vo.id}" /></td>
									<td align="center">{$vo['id']}</td>
									<td align="center">{$vo['account']}</td>
									<td align="center">{$vo['nickname']}</td>
									<td align="center">{$vo['email']}</td>
									<td align="center">{$vo['create_time']|date="Y-m-d",###}</td>
									<td align="center"><?php
										if ($vo['last_login_time'] == 0){
											echo '从未登录过';
										}else{
									?>{$vo['last_login_time']|date="Y-m-d H:i:s",###}<?php } ?></td>
									<td align="center">{$vo['login_count']}</td>
									<td align="center">{$vo['status']|getStatus}</td>
									<td align="center">{$vo['status']|showStatus=$vo['id']}&nbsp;&nbsp;|&nbsp;&nbsp;<a href="{:U('user/edit',array('id'=>$vo["id"]))}" class="edit_user">编辑</a></td>
								</tr>
								</volist>
							</table>
							</form>
							
							<div class="page">{$page}</div>
							
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        
        <include file="Public:footer" />
    </body>
</html>